{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e57a6ab3",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Author : jiang\n",
    "# week 04\n",
    "\n",
    "user_data = \"jiang\"\n",
    "user_password = \"123456\"\n",
    "count = 3\n",
    "while True:\n",
    "    username = input(\"请输入正确的账号:\")\n",
    "    password = input(\"请输入正确的密码：\")\n",
    "    count -=1\n",
    "\n",
    "# 登陆系统\n",
    "# 我需要循环，但是循环的条件好像不能用range来解决\n",
    "# while True 设置条件，可终止循环\\\n",
    "# while True 可实现 for+range 的功能\n",
    "\n",
    "    if username == user_data:\n",
    "            if password == user_password:\n",
    "                print(\"登陆成功，欢迎\",username,\"使用~\")\n",
    "       #什么时候退出呢？当账号和密码都是正确的情况下\n",
    "                break\n",
    "            else:\n",
    "                if count == 0 :\n",
    "                    print(\"哈哈哈哈哈哈，您的账号被锁定了哈哈哈哈哈哈哈哈哈哈，要五分钟后才可以尝试。\")\n",
    "                    break\n",
    "                else:\n",
    "                    print(\"您的账号或密码不正确，您还有%s次机会\"%(count))\n",
    "                    #%s代表 string\n",
    "                    # %d代表 number\n",
    "                    # %f代表 float\n",
    "\n",
    "    else :\n",
    "         if count == 0:\n",
    "            print(\"哈哈哈哈哈哈，您的账号被锁定了哈哈哈哈哈哈哈哈哈哈，要五分钟后才可以尝试\")\n",
    "            break\n",
    "        else:\n",
    "            print(\"您的账号或密码不正确，您还有%s次机会\"%(count))\n",
    "\n",
    "\n",
    "#设置会员"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
